private ["_track_group","_allgroups","_side","_i","_group"];

_track_group = {
	private ["_grp","_mkr","_m","_ldr"];
	_grp = _this select 0;
	_mkr = format ["%1",_grp];
	clearGroupIcons group _x;
	group _x addGroupIcon ["x_art",[0,0]];

	while {{alive _x} count (units _grp) >= 1} do {
	    _ldr = leader _grp;
		group _x setGroupIconParams ["colorBlue", "", 0.5, true];
	    sleep 1;
	};
        deleteMarker _m;
};

_side = _this select 0;
_allgroups = allGroups;

for "_i" from 0 to (count _allgroups)-1 do {
	_group = allgroups select _i;
	if (side _group == _side) then {
		nul = [_group] spawn _track_group;
	};
	sleep 0.5;
};